package com.test.clyq.serviceImpl;

import java.util.List;

import com.test.clyq.dao.CommentDao;
import com.test.clyq.entity.Comment;
import com.test.clyq.entity.Users;
import com.test.clyq.service.CommentService;
import com.test.service.impl.BaseManager;
import com.test.util.Pagination;

/**
 * CommentServiceImpl. <br>
 * 评论管理.
 * <p>
 * Copyright: Copyright (c) 2010-4-18 下午02:44:13
 * <p>
 * Company: 北京宽连十方数字技术有限公司
 * <p>
 * Author: liuxl@c-platform.com
 * <p>
 * Version: 1.0
 * <p>
 */
@SuppressWarnings("unchecked")
public class CommentServiceImpl extends BaseManager implements CommentService {

	private CommentDao commentDao;

	public CommentDao getCommentDao() {
		return commentDao;
	}

	public void setCommentDao(CommentDao commentDao) {
		this.commentDao = commentDao;
	}

	public boolean deleteComment(Long id, Users user) {
		return commentDao.deleteComment(id, user);
	}

	public List<Comment> getCommentByPage(Pagination pagination, Long pid, Integer type) {
		return commentDao.getCommentByPage(pagination, pid, type);
	}

	public Comment getOneComment(Long id) {
		return commentDao.getOneComment(id);
	}

	public void saveOrUpdateComment(Comment comment, Users user) {
		commentDao.saveOrUpdateComment(comment, user);
	}
}
